package drexel.db;

import java.util.ArrayList;
import java.util.List;

import drexel.model.Movie;

public interface DataAccess {

    boolean open();

    void close();

    boolean saveMovie(Movie movie);

    MovieData getAllMoviesAndGenresByDirector(String directorName);

    MovieData getAllMoviesAndGenresByActor(String firstName, String lastName);

    public class MovieData {

        private List titles = new ArrayList();
        private List genres = new ArrayList();

        public MovieData() {
        }

        public MovieData(List titles, List genres) {

            this.titles = titles;
            this.genres = genres;
        }

        public List getTitles() {

            return titles;
        }

        public void addTitle(String title) {

            titles.add(title);
        }

        public List getGenres() {

            return genres;
        }

        public void addGenre(String genre) {

            genres.add(genre);
        }

        public void print() {

            System.out.println("Movies");

            for (int i = 0; i < titles.size(); i++) {

                System.out.println("    " + titles.get(i));
            }

            System.out.println("");

            System.out.println("Genres");

            for (int i = 0; i < genres.size(); i++) {

                System.out.println("    " + genres.get(i));
            }
        }
    }
}
